<?php

require '../model/dixingsetmodel.php';

class dixingsetcontrol{
	private $model;//业务模型
	private $view;

	public function __construct(){
		
		$this->view="../view/main.php?url=dixingset.php";
		$this->model=new dixingsetmodel();
		
		
	}


	public function load($view=null){
		if(empty($view))
		{				
			header("location:{$this->view}");
		}
		else{
			header("location:{$view}");
		}

	}
	public function doAction($action){


		if($action=='crush'){			
			$this->action_crush();
		}
		else if ($action=='img'){
			
			$this->action_img();
		}
		else{
			$this->load();
		}

	}

	//修改碰撞值
	public function action_crush(){
		$crushid=$_GET['crushid'];
		$crushval=$_POST['crushval'];
		//echo "444".$crushid;
		if (!empty($crushval)){
			$upload=new upload();
			$img=$upload->upload_file();
			$crush1=new dixingsetmodel();
			$crush1->crush($crushval,$crushid,$img);
		}
		//回自己界面
		$this->load($this->view);
	}
	
}
?>